import httpUtil from '../utils/request'

export function userPage(username,page,limit){
  const params = {
      username,
      page,
      limit
  }
  return httpUtil({
      url: '/user/page',
      method: 'get',
      params: params
  })
}

export function userDel(usernames){
  const data = {
    usernames
  }
  return httpUtil({
      url: '/user/del',
      method: 'post',
      data: data
  })
}

export function userUpdatePwd(username,oldPassword,newPassword){
  const data = {
    username,
    oldPassword,
    newPassword
  }
  return httpUtil({
      url: '/user/updatePwd',
      method: 'post',
      data: data
  })
}

export function userAdd(username,password){
    const data =  {
        username,
        password
    }
    return httpUtil({
      url: '/user/add',
      method: 'post',
      data: data
  })
}